<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  .main {
    width: 680px;
    height: 680px;
    margin: 0 auto;
    position: relative;
    background: #ccc;
  }

  .egg-img {
    width: 100%;
    height: 100%;
    background: url("./img/SpriteFigure.png") no-repeat;
    position: absolute;
    left: 0;
    top: 0;
    background-size: cover;
  }

  .position-animation {
    animation: changeEggBg 1s steps(1, end) both;
  }

  /*砸下去，蛋变化效果*/
  @keyframes changeEggBg {
    0% {
      background-position: 0 0;
    }

    50% {
      background-position: -680px 0;
    }

    100% {
      background-position: -1360px 0;
    }
  }
</style>

<body>
  <div class="main">
    <div class="egg-img position-animation"></div>
  </div>
</body>

</html>